package com.honey.spring.signal;

import java.io.File;

import com.honey.compilation.xml.Attribute;
import com.honey.compilation.xml.XmlElement;

class XmlSignal implements SignalKind{
	
	private XmlElement xmlElement = null;
	
	private String  beanId = null;
	
	private String  className= null;
	
	private File springContextFile= null;
	
	public XmlSignal(XmlElement xmlElement ){
		Attribute att = xmlElement.getAttribute("id");
		if( att != null){
			this.beanId = att.getValue();
		}
		att = xmlElement.getAttribute("class");
		if( att != null){
			this.className = att.getValue();
		}
		if(this.beanId != null && this.className != null ){
			this.xmlElement = xmlElement;
		}
	}

	@Override
	public boolean checking() {
		return xmlElement != null;
	}
	
	@Override
	public String getBeanId() {
		return beanId;
	}

	@Override
	public String getBeanClassName() {
		return className;
	}
	
	@Override
	public XmlElement getXmlElement() {
		return xmlElement;
	}

	@Override
	public File context() {
		
		return springContextFile;
	}

	public File getSpringContextFile() {
		return springContextFile;
	}

	public void setSpringContextFile(File springContextFile) {
		this.springContextFile = springContextFile;
	}

	

}
